package com.kgc.springboot.aviation.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.LocaleResolver;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author shkstart
 * @create 2020-12-29 14:18
 */
@Configuration
public class MySpringMVCConfiguration implements WebMvcConfigurer {

    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        registry.addViewController("/").setViewName("index2");
        registry.addViewController("/ces").setViewName("ces");
        registry.addViewController("/index").setViewName("index");
        registry.addViewController("/hudong").setViewName("hudong");
        registry.addViewController("/user").setViewName("user");
        registry.addViewController("/feedback").setViewName("feedback");
        registry.addViewController("/登录").setViewName("登录");
    }

    @Bean
    public LocaleResolver localeResolver(){
        return new MyLocaleResolver();
    }



}